//
//  BrokerAccountViewController.m
//  WGFGlobalHouse
//
//  Created by waiguofang on 15/4/15.
//  Copyright (c) 2015年 waiguofang. All rights reserved.
//  经纪人账号管理

#import "BrokerAccountViewController.h"
#import "TraderMiddleManFooterView.h"
#import "TraderMiddleManHeaderView.h"
#import "AddMiddleManViewController.h"
#import "TraderMiddleManCell.h"
#import "SearchBarView.h"


#define ROWHEIGT  60;
@interface BrokerAccountViewController ()<UITableViewDelegate,UITableViewDataSource,TraderMiddleManFooterViewDelegate,TraderMiddelManCellDelegate>

//底部的按钮view;
@property(nonatomic,weak) TraderMiddleManFooterView *footerView;

//@property (strong, nonatomic) UITableView *tableView;
@property (strong, nonatomic) NSArray *lastIndexpathArr;





@end

@implementation BrokerAccountViewController

- (void)viewDidLoad {


    [super viewDidLoad];
    [self.titleView setMianTitle: @"经纪人账号"];
    
    [self addSearchBarView];
    [self addTableView];
    [self addRightEditItemAndAddItem];
//    self.isEdit = NO;


}

-(void)addTableView
{
    self.tableView = [[UITableView alloc]init];
    self.tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 104, UIScreenWidth, UIScreenHeight-44) style:UITableViewStylePlain];
    
//    [self.tableView setBackgroundColor:[UIColor redColor]];

    self.tableView.delegate = self;
    self.tableView.dataSource = self;
    [self.view addSubview:self.tableView];
    self.tableView.rowHeight =44;
}
-(void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:YES];
}

#pragma mark 点击了添加按钮
-(void)clickAddItem
{
    AddMiddleManViewController *addVC = [[AddMiddleManViewController alloc]initWithNibName:@"AddMiddleManViewController" bundle:nil];
    addVC.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:addVC animated:YES];

}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section;
{
    return  100
    ;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;
{

    TraderMiddleManCell *cell = [TraderMiddleManCell cellWithTableView:tableView withRow:indexPath.row withlabShow:YES withIsMiddleMan:NO];
     return cell;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark  TraderMiddleManFooterViewDelegate ---点击了移动按钮，跳转到选择门店页面
-(void)tradermiddleManFooterViewClickMoveBtn
{
    AddMiddleManViewController *addVC = [[AddMiddleManViewController alloc]initWithNibName:@"AddMiddleManViewController" bundle:nil];
    addVC.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:addVC animated:YES];

}

@end
